<?php
namespace AuctionCore\CarDealer;
use Think\Exception;

/**
* 代金卷 单元测试
* @author       Eric Lee
*/
class AssetTest extends \PHPUnit_Framework_TestCase {

      public static  function testCouponList(){

          $a = new AssetCenter();
          $cond = '1';
          $rs = $a->get_coupons($cond,$order='dc.createtime desc','0', '20');
          self::assertTrue($rs?true:false);

      }

      public static  function testGetBailLogs(){

          $a = new AssetCenter();
          $cond = '1';
          $rs = $a->get_bail_logs($cond,$order='createtime desc','0', '20');
          self::assertTrue($rs?true:false);
      }


      public static  function testBailRechange(){         
          $a = new AssetCenter(20);
          try{
              $rs = $a->bail_recharge('2000',3,'给我的保证金充值');
          }catch (\Exception $e){
              echo $e->getMessage();
              $rs = false;
          }
          self::assertTrue($rs?true:false);
      }

      public static  function testBailSituation(){

          $dealer_id = M('car_dealer')->max('dealer_id');
          $a = new AssetCenter($dealer_id);
          $rs = $a->bail_situation();
          //dump($rs,true,null,false);
          self::assertTrue($rs?true:false);
      }

      public function testFreeze(){         
          $a = new AssetCenter(20);
          try{
              $rs = $a->freeze(3,2000,'冻结保证金');
          }catch (\Exception $e){
              echo $e->getMessage();
              $rs = false;
          }
          self::assertTrue($rs?true:false);
      }

       public function testFree(){         
          $a = new AssetCenter(20);
          try{
              $rs = $a->free(3,'解冻保证金');
          }catch (\Exception $e){
              echo $e->getMessage();
              $rs = false;
          }
          self::assertTrue($rs?true:false);
      }




}

?>